package com.dagr.wordboxoid.content;

public class WordCard {

	private String mSide1;
	private String mSide2;

	private WordCard() {
	}

	public String getSide1() {
		return mSide1;
	}

	public String getSide2() {
		return mSide2;
	}

	public static class Builder {

		private final WordCard mWordCard;

		public Builder() {
			mWordCard = new WordCard();
		}

		public Builder side1(String side1) {
			mWordCard.mSide1 = side1;

			return this;
		}

		public Builder side2(String side2) {
			mWordCard.mSide2 = side2;

			return this;
		}

		public WordCard build() {
			if (mWordCard.mSide1 == null || mWordCard.mSide1.trim().length() == 0) {
				throw new IllegalStateException("side1 must not be empty");
			}

			if (mWordCard.mSide2 == null || mWordCard.mSide2.trim().length() == 0) {
				throw new IllegalStateException("side2 must not be empty");
			}

			return mWordCard;
		}

	}

}
